const fs = require('fs');
const jwt = require('jsonwebtoken');
const privalPassword = fs.readFileSync('key1.pem'); // 私钥

const user = {
  a: '1',
  b: '2'
};

const token = jwt.sign(user, privalPassword, { algorithm: 'RS256' });

console.log(token);
